package com.xfanonymous.cloud.api;

import com.xfanonymous.cloud.resp.ResultData;
import com.xfanonymous.cloud.resp.ReturnCodeEnum;
import org.springframework.stereotype.Component;

/**
 * @auther xfanonymous
 * @create 2024-01-05 13:07
 *
 * 1. PayFeignSentinelApi指定当前类统一处理触发异常后的降级处理
 * 2. 当前类要实现PayFeignSentinelApi接口对应的方法
 */
@Component
public class PayFeignSentinelApiFallBack implements PayFeignSentinelApi
{
    @Override
    public ResultData getPayByOrderNo(String orderNo)
    {
        return ResultData.fail(ReturnCodeEnum.RC500.getCode(),"对方服务宕机或不可用，FallBack服务降级o(╥﹏╥)o");
    }
}
